﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            Test3();

        }

       
        static void Test()
        {
            //乘法口诀
            for (int i = 1; i <= 9; i++)
            {

                for (int j = 1; j <= i; j++)
                {
                    Console.Write("i" + "*j" + "=" + i * j + " ");
                }
                Console.WriteLine();
            }
        }
        static void Test3() 
        {
            Console.WriteLine("请输入奇数：");
            int x = Int32.Parse(Console.ReadLine());
            int y = (x - 1) / 2;

            for (int a = 1; a <= y; a++)   //打印菱形前一半
            {
                for (int c = 1; c <= y - a + 1; c++)
                {
                    Console.Write(" ");
                }
                for (int b = 1; b <= a; b++)
                {
                    Console.Write("* ");
                }
                Console.WriteLine();
            }
            for (int z = 1; z <= y + 1; z++)  //打印中间行
            {
                Console.Write("* ");

            }
            Console.WriteLine();
            for (inta1 = y; a1 >= 1; a1--)  //打印菱形后一半
            {
                for (int c1 = 0; c1 <= y - a1; c1++)
                {
                    Console.Write(" ");
                }
                for (int b1 = 1; b1 <= a1; b1++)
                {
                    Console.Write("* ");
                }
                Console.WriteLine();
            }


            Console.ReadLine();
       



        }
        static void Test4() 
        {//插入数排序

            Console.WriteLine("请输入要插入的值");
            int num = int.Parse(Console.ReadLine());

            int[] arr1 = { 90, 80, 70, 40, 20 };
            int[] arr2 = new int[arr1.Length + 1];

            for (int i = 0; i < arr1.Length; i++)
            {
                arr2[i] = arr1[i];
                arr2[arr2.Length - 1] = num;
            }
            int temp;
            for (int i = 0; i < arr2.Length; i++)   
            {
                for (int j = 0; j < arr2.Length - 1 - i; j++)
                {
                    if (arr2[j + 1] > arr2[j])
                    {
                        temp = arr2[j + 1];
                        arr2[j + 1] = arr2[j];
                        arr2[j] = temp;
                    }

                }
                
            }
            for (int i = 0; i < arr2.Length; i++)
            {
                Console.Write(arr2[i]+" ");

            }


        }
        static void Test2() 
        {//空心正边形
            Console.WriteLine("请输入正方形的边长");
            int num = int.Parse(Console.ReadLine());

            for (int i = 1; i <= num; i++)
            {
                for (int j = 1; j <= num; j++)
                {
                    if (i == 1 || i == num || j == 1 || j == num)
                    {
                        Console.Write("*");
                    }
                    else
                    {
                        Console.Write(" ");
                    }
                    
                }
                Console.WriteLine("");
            }
        }

    }
}
